using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class RedPoint : MonoBehaviour
{
    [SerializeField] private Text Text;

    public void Init(string path)
    {
        ColorLog.LogCyan(path);
        RedPointMgr.Instance.AddCallback(path, Refresh);
    }

    public void Refresh(RedPointNote note)
    {
        ColorLog.LogCyan(note.name);
        gameObject.SetActive(true);

        if (note.RedCount > 0)
        {
            Text.text = note.RedCount.ToString();
        }
        else
        {
            gameObject.SetActive(false);
        }
    }
    public void TestGit()
    {
        ColorLog.LogCyan("挤压波");
    }
}
